package com.neusoft.modules.web.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neusoft.modules.web.dao.ChunkUploadDao;
import com.neusoft.modules.web.entity.ChunkInfoEntity;
import com.neusoft.modules.web.service.ChunkUploadService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service("chunkUploadService")
public class ChunkUploadServiceImpl extends ServiceImpl<ChunkUploadDao, ChunkInfoEntity> implements ChunkUploadService {

    @Resource
    private ChunkUploadDao chunkUploadDao;

    @Override
    public List<ChunkInfoEntity> queryChunkInfoByIdentifier(String identifier, String fileName) {
        List<ChunkInfoEntity> list = chunkUploadDao.queryChunkInfoByIdentifier(identifier, fileName);
        return list;
    }

    @Override
    public boolean saveChunkInfo(ChunkInfoEntity chunkInfo) {
        return this.save(chunkInfo);
    }
}
